﻿using DataModels.Dto;
using DataModels.Dto.ParkingLot;
using Microsoft.AspNetCore.Mvc;
using Services.ParkingLot;

namespace PropertyManagementWebApi.Controllers.ParkingLot
{
    public class ParkingSpaceController(ParkingSpaceService parkingSpaceService) : BaseController
    {
        protected readonly ParkingSpaceService _parkingSpaceService = parkingSpaceService;

        /// <summary>
        /// 获取登录人车位信息
        /// </summary>
        /// <param name="ProjectUUID">项目ID</param>
        /// <returns></returns>
        [HttpGet]
        public ResponseModel GetParkingSpaceInfo(Guid ProjectUUID)
        {
            return _parkingSpaceService.GetParkingSpaceInfo(ProjectUUID);
        }

        /// <summary>
        /// 获取项目的停车位信息
        /// </summary>
        /// <param name="ProjectUUID"></param>
        /// <returns></returns>
        [HttpPost]
        public ResponseModel GetParkingSpaceList(ParkingRequestDto requestDto)
        {
            return _parkingSpaceService.GetParkingSpaceList(requestDto);
        }

        /// <summary>
        /// 修改登录人车位信息
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [HttpPost]
        public ResponseModel EditParkingSpaceInfo(EditParkingSpaceInfo info)
        {
            return _parkingSpaceService.EditParkingSpaceInfo(info);
        }

        /// <summary>
        /// 获取缴费信息
        /// </summary>
        /// <param name="ProjectId"></param>
        /// <param name="ParkingSpaceId"></param>
        /// <returns></returns>
        [HttpGet]
        public ResponseModel GetParkingSpacePaymentInfo(Guid ProjectId, Guid ParkingSpaceId)
        {
            return _parkingSpaceService.GetParkingSpacePaymentInfo(ProjectId, ParkingSpaceId);
        }

        /// <summary>
        /// 车位缴费
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        [HttpPost]
        public ResponseModel ParkingSpacePayment(ParkingSpacePayment info)
        {
            return _parkingSpaceService.ParkingSpacePayment(info);
        }
    }
}
